<template>
  <div class="option">
    <h2>猜你喜欢</h2>
    <div class="bigbox">
       <div :class ="{active:currentIndex == index}" @click="fun(index)" class="name" v-for="(item,index) in str" :key="index"> {{item}} </div>
    </div>
    <div class="hei">
        <span class="biao" v-for="(item,index) in stt" :key="index"> {{item}} </span>
    </div>
    <div class="caidan"  v-for="(item,index) in arr" :key="index">
        <div class="imgbox">
            <img :src="item.img" alt="" class="tu">
        </div>
        <div class="jieshao">
            <h3 class="hh"> {{item.hh}} </h3>
            <div class="yue"> {{item.yue}} </div>
            <span class="bin"> {{item.bin}} </span><span class="fenzhong"> {{item.fenzhong}}</span>
            <div class="ss">
                <span class="chao">{{item.chao}}</span>
            </div>
            <div class="manjian">
                <span class="jian"> {{item.jian}} </span><span class="jian1"> {{item.jian}} </span><span class="jian2"> {{item.jian}} </span>
            </div>

        </div>
    </div>
    <div class="dibu">
        <div @click="add(index)" :class="{action:con == index}" class="shao" v-for="(item,index) in arr1" :key="index">
            <p > {{item}} </p>
        </div>
    </div>
  </div>
</template>

<script>
var img1 = "https://img0.baidu.com/it/u=317866587,988618494&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500";
var img2 = "https://img0.baidu.com/it/u=424305162,2088133468&fm=253&fmt=auto&app=138&f=JPEG?w=200&h=200";
export default {
    data(){
        return{
            str:["综合排序","距离最近","销量最高","筛选"],
            
            stt:["年货节热卖","津贴联盟","满减优惠","品质联盟"],
            currentIndex:0,
            con:0,
            arr:[
                {img:img1,yue:"月销:230",hh:"明洞炸鸡(兰岛店)",bin:"起送￥20  远距离配送￥3",fenzhong:"47分钟 3.9km",chao:"快乐炸鸡棒棒",jian:"35减12",jian1:"70减35",jian2:"100减45"},
                {img:img2,yue:"月销:1690",hh:"甜品蛋糕(兰岛店)",bin:"起送￥60  远距离配送￥8",fenzhong:"67分钟 10.9km",chao:"甜到你的心里",jian:"35减12",jian1:"70减35",jian2:"100减45"},
            ],
            arr1:["首页","订单","我的"],
            
        }
    },
    methods:{
         fun(index){             
             this.currentIndex = index;     
            //  console.log(this.currentIndex);               
         },
         add(index){
             this.con = index;
         }
    },


}
</script>

<style lang="scss" scoped>
.option h2{
    margin: 16px 0px 10px 10px;
}
.option .bigbox{
    display: flex;
    justify-content: space-around;
}
.option .bigbox .name{
    font-size: 18px;
    font-weight: 500;
}
.option .hei{
    display: flex;
    justify-content: space-around;
    margin: 13px 0px;
}
.option .hei span{
    display: block;
    width: 23%;
    height: 30px;
    background-color: #eeecec;
    border-radius: 5px;
    text-align: center;
    line-height: 30px;
}
.option>.bigbox>.active{
    font-weight: 800;
    font-size: 18px;
}
.caidan{
    display: flex;
    justify-content: space-between;
}
.caidan .imgbox{
    width: 120px;
    height: 150px;
}
.caidan .imgbox .tu{
    width: 120px;
    height: 120px;
}
.caidan .jieshao{
    width: 300px;
    height: 130px;
}
.caidan .jieshao .ss .chao{
    width: 40px;
    height: 10px;
    background-color: rgba($color: #f0601d, $alpha: 0.5);
    margin: 5px 5px;
}
.caidan .jieshao .manjian span{
    border: solid 1px red;
    color: red;
    font-size: 12px;
    margin:5px 5px;
}
.dibu{
    width: 375px;
    height: 50px;
    border-top: solid 1px #d3cccc;
    display: flex;
    justify-content: space-around;
    text-align: center;
    line-height: 50px;
    position: fixed;
    bottom: 0;
    background-color: #fff;
}
.dibu .action{
    color: royalblue;
    font-weight: bold;
}
</style>